MAKEFLAGS ?= -j5

all: json2.so

json2.so: src/modules/json2.so
	cp $? $@

src/modules/json2.so: src/Makefile
	( cd src && ${MAKE} ${MAKEFLAGS} )

src/Makefile: src/configure
	( cd src && ./configure --disable-json2 )

src/configure: src/config.m4 src/package.xml
	( cd src && phpize )

clean:
	( cd src && phpize --clean )

distclean: clean
	rm -f json2.so

install: src/modules/json2.so
	( cd src && ${MAKE} ${MAKEFLAGS} install )

